package com.aia.ilp.web.sanity;

import org.apache.log4j.Logger;

import com.aia.ilp.service.MainService;
import com.opensymphony.xwork2.ActionSupport;

public class TestnewcustAction extends ActionSupport {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(TestnewcustAction.class);

	private static final long serialVersionUID = 1L;
	private MainService mainService;
	private String myaction;

	/***
	 * nouse
	 */
	public String execute() {
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - start"); //$NON-NLS-1$
		}
		
		if (myaction.equals("insert")) {
			mainService.sanityTestnewcustdb((ActionSupport) this);
		} else if (myaction.equals("del")) {
			mainService.sanityTestnewcustdbDelete((ActionSupport) this);
		} else {
			addActionMessage("非法参数");
			return INPUT;
		}
		
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public void setMainService(MainService mainService) {
		this.mainService = mainService;
	}

	public MainService getMainService() {
		return mainService;
	}

	public void setMyaction(String myaction) {
		this.myaction = myaction;
	}

	public String getMyaction() {
		return myaction;
	}

}
